index.js ➔ $   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 22
rs 9.2
c 1
b 0
f 0
cc 1
nc 1
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ ... ➔ ??? 0 6 1
1
import axios from 'axios';
2
import DriverConfigsComponent from './driver_configs';
3
import Vue from 'vue';
4
5
// register global utilities
6
require('assets/js/boot');
7
8
$(function() {
9
    // find the element we're going to mount our component to
10
    const el = document.querySelector('[data-component=driver-configs]');
11
12
    // parse our props from data attributes
13
    const drivers = JSON.parse(el.dataset.drivers);
14
    const lang = JSON.parse(el.dataset.lang);
15
16
    // configure axios with our csrf token
17
    axios.defaults.headers.common['X-CSRF-TOKEN'] = el.dataset.token;
18
19
    // instantiate our component and mount it to the dom
20
    new Vue({
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Vue({IdentifierNode(...alse))))),false,true)}) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
21
        el,
22
        render: h => h(DriverConfigsComponent, {
23
            props: {
24
                drivers,
25
                lang,
26
            },
27
        }),
28
    });
29
});
30